package com.gildedrose;

public class BackstagePasses extends Item{

    public BackstagePasses(String name, int sellIn, int quality) {
        super("Backstage passes", sellIn, quality);
    }

    public BackstagePasses(int sellIn, int quality) {
        super("Backstage passes", sellIn, quality);
    }

    @Override
    public void updateQualityAfterExpiration() {
        this.quality = 0;
    }

    @Override
    public void updateQuality() {
        this.quality = Math.min(50, this.quality + 1);
        if (this.sellIn < 11) {
            this.quality = Math.min(50, this.quality + 1);
        }
        if (this.sellIn < 6) {
            this.quality = Math.min(50, this.quality + 1);
        }
    }
}
